home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 4
/
Mac Giga-ROM 4.0 - 1993.toast
/
FILES
/
EXT
/
A-E
/
Auto_Idle.cpt
/
AutoIdle doc
next >
Wrap
Text File
|
1987-12-21
|
5KB
|
102 lines
AutoIdle Documentation 12/21/87
Larry Rosenstein
This is yet another of those automatic screen blanking utilities, called
AutoIdle. It should be compatible with all versions of the Macintosh,
including a Mac II with multiple screens. It is also compatible with Multifinder.
To use it, you place the AutoIdle file in your System Folder and reboot the
machine. After 5 minutes of inactivity, the screen will be blanked and an
icon will appear at random places of the screen. In general, AutoIdle tries
to display the icon of the application that is running. You can modify this
as described below. The name of the application will appear under the
icon.
To restore the screen, move the mouse, click the mouse, hit a key, or
insert a diskette. The screen will also be restored if a window is created
or removed from the screen. (This is useful when downloading a file, for
example, since you will notice when the download finished.) Any of these actions
also resets the 5 minute delay.
If you move the mouse in a special rectangle of the screen, it will be
blanked immediately. Initially this is defined by the coordinates (0, 0) and
(2, 2), but can be changed. You must leave the mouse in that position for
about 1/2 second before the screen will be blanked.
The advantage of AutoIdle is that it doesn't take over the machine when it
blanks the screen. In fact you can be downloading a file from a BBS and the
screen can be blanked, yet the download will continue. The same is true of
printing.
The downside of this is that AutoIdle does not save the original screen
display and relies on the application to regenerate it. Also, it doesn't try
to prevent the application from changing the display. If the application
does change the display the utility will just blank the screen again. (You
can see why it doesn't make sense for the utility to save the screen
display, since the application might be changing it.)
AutoIdle works by intercepting the GetNextEvent and TickCount traps in the
Macintosh, and blanking/restoring the screen when the application calls those
traps. This design makes it very unobtrusive, but it also means that AutoIdle
won't get control unless the application calls one of these traps. So if you are
doing a long computation, the screen might never be blanked.
You can customize AutoIdle using ResEdit. Inside the file is a resource of
type 'idle'. The first 4 bytes of the resource is the delay (in 1/60 seconds)
until blanking the screen; the next 4 bytes the delay between moving the
icon; the next 8 bytes is the magic rectangle (in screen coordinates). The
rest of the resource is a list of possible icons to use.
The icon list starts with 2 bytes which is the number of icons. Then comes
a series of pairs (resource type, resource ID). To choose the icon, AutoIdle
just runs down the list until it finds one of those resources. The default
list consists of:
ICN# 128 usually the application's icon
ICN# 131 folder icon in Finder
ICN# 3 Mac icon in System file
If AutoIdle doesn't find an icon, it uses a gray rectangle. This will never
happen in the default case because ICN# 3 will always be found.
Accompanying AutoIdle should be a file called AutoIdle TMPL. If you open
this file in ResEdit you will find a resource of type TMPL. If you paste this
resource into ResEdit itself, then you will be able to edit the 'idle'
resource in a convenient way (rather than as hex). If you do this, make
sure that the ID of the AutoIdle TMPL resource doesn't conflict with
another TMPL in your version of ResEdit.
Please send all your comments & suggestions to me. One things I would
like to do is write an application that allows you to customize the 'idle'
resource without using ResEdit, but I haven't done it yet.
Send those cards & letters to:
Larry Rosenstein
Apple Computer, Inc.
20525 Mariani M/S 32-E
Cupertino, CA 95014
Usenet: {sun, nsc}!apple!lsr
CSNet: lsr@Apple.com
AppleLink: Rosenstein1
Change History:
1.0a7 11/6/87: First version posted to Usenet & beyond.
1.0a10 12/21/87: Second version posted to Usenet.
Fixed bug with not preserving the current port
(some applications would get a funny font in its
menus, or start using the wrong port).
Made mouse move restore the screen.
Clicking is not required to blank the screen immediately.
Use a patch to PostEvent to tell when an event comes in.
Calls to TickCount can cause screen blanking.
Preserve most of the registers.
Fixed problem with color support; needed to set the
current GDevice before calling Index2Color.
Shrink the GrayRgn to nothing when blanking to prevent
"behaved" applications from drawing on the screen.